package com.caimiao.miao.library.usb.logic;

import android.support.annotation.IntDef;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;

public class UsbCode {
    /**
     * 设置出票个数
     */
    public static final int SET_TICKET_VALUE = 0x03;
    /**
     * 返回出票个数
     */
    public static final int RET_TICKET_VALUE = 0xc3;
    /**
     * 获取出票个数
     */
    public static final int GET_TICKET_VALUE = 0x83;

    /**
     * 获取感应状态
     */
    public static final int GET_INDUCTION_STATUS = 0x84;
    /**
     * 返回感应状态
     */
    public static final int RET_INDUCTION_STATUS = 0xc4;
    /**
     * 获取连接状态
     */
    public static final int GET_CONNECT_STATUS = 0x85;
    /**
     * 返回连接状态
     */
    public static final int RET_CONNECT_STATUS = 0xc5;

    /**
     * 数据包开始位
     */
    public static final char PACKAGE_START = 0x55;
    /**
     * 数据包长度位
     */
    public static final char PACKAGE_LENGTH = 0x07;
    /**
     * 数据包结束位
     */
    public static final char PACKAGE_END = 0x99;

    public static final int SCHEDULER_STATUS_WRITE = 0;
    public static final int SCHEDULER_STATUS_READ = 1;
    public static final int SCHEDULER_STATUS_TIMEOUT = 2;

    @IntDef({SET_TICKET_VALUE, RET_TICKET_VALUE, GET_TICKET_VALUE, GET_INDUCTION_STATUS, RET_INDUCTION_STATUS, GET_CONNECT_STATUS, RET_CONNECT_STATUS,
            SCHEDULER_STATUS_WRITE, SCHEDULER_STATUS_READ, SCHEDULER_STATUS_TIMEOUT})
    @Retention(RetentionPolicy.SOURCE)
    public @interface Code {
    }
}
